Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(screenshots): allow fullPage + clip, add tests #1194

Merged
merged 1 commit into from
Mar 4, 2020
Merged

fix(screenshots): allow fullPage + clip, add tests #1194

merged 1 commit into from
Mar 4, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Mar 3, 2020

No description provided.

src/platform.ts Outdated
@@ -234,9 +234,9 @@ export function urlMatches(urlString: string, match: types.URLMatch | undefined)
return match(url);
}

export function pngToJpeg(buffer: Buffer): Buffer {
export function pngToJpeg(buffer: Buffer, quality: number | undefined): Buffer {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: quality?: number

return clip;
const p1 = { x: Math.min(clip.x, viewportSize.width), y: Math.min(clip.y, viewportSize.height) };
const p2 = { x: Math.min(clip.x + clip.width, viewportSize.width), y: Math.min(clip.y + clip.height, viewportSize.height) };
function trimClipToSize(size: types.Size, clip: types.Rect): types.Rect {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: invert params order to match the method's name?

@dgozman
Copy link
Contributor Author

dgozman commented Mar 3, 2020

All done.

@dgozman dgozman merged commit 1b863c2 into microsoft:master Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants